<?php
/**
 * Abstract model of an SQL table. Needs to be extended by a model providing its vendor-specific implementation.
 * 
 * Following queries implementations are entirely dependent on specific table, therefore cannot be abstracted:
 * - alter()
 * - create()
 * - select()
 * - insert() / replace()
 * - update()
 * - delete()
 */
abstract class SQLTable {
	/**
	 * Table name. To be overridden by actual table model children.
	 * 
	 * @var string $strTableName
	 */
	protected $strTableName;
	
	/**
	 * Database name. To be overridden by actual table model children.
	 * 
	 * @var string $strDatabaseName
	 */
	protected $strDatabaseName;
	
	/**
	 * SQL server implementation your table model must connect to to run queries on. To be set inside table actual table model children constructors.
	 *  
	 * @var SQLServer server
	 */
	protected $server;
	
	/**
	 * Shows columns information for current table
	 * 
	 * @return array(string=>mixed)
	 */
	abstract public function describe();
	
	/**
	 * Drops current table.
	 * 
	 * @return void
	 */
	abstract public function drop();
	
	/**
	 * Truncates current table.
	 * 
	 * @return void
	 */
	abstract public function truncate();
	
	/**
	 * Renames current table.
	 * 
	 * @param string $strNewTableName
	 * @return void
	 */
	abstract public function rename($strNewTableName);
}